{extend name="../../admin/view/main"}

{block name="button"}
<!--{if auth('config')}-->
<a class="layui-btn layui-btn-sm layui-btn-primary" data-modal="{:url('config')}" data-width="900px">用户提现配置</a>
<!--{/if}-->

<!--{if auth('payment')}-->
<a class="layui-btn layui-btn-sm layui-btn-primary" data-modal="{:url('payment')}">微信转账配置</a>
<!--{/if}-->

<!--{if auth('sync')}-->
<a class="layui-btn layui-btn-sm layui-btn-primary" data-queue="{:url('sync')}">后台打款服务</a>
<!--{/if}-->
{/block}

{block name="content"}
<div class="think-box-notify">
    <!-- 0 $total, 1 $count, 2 $audit, 3 $locks -->
    提现统计：已产生提现累计 <b>{$transfer.0|default=0.00}</b> 元（ 含待转账 <b>{$transfer.3|default='0.00'}</b> 元，含待审核 <b>{$transfer.2|default='0.00'}</b> 元 ），累计已提现 <b>{$transfer.1|default=0.00}</b> 元。
</div>
<div class="think-box-shadow">
    {include file='user/transfer/index_search'}
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th>提现用户</th>
            <th>提现订单</th>
            <th>提现通道</th>
            <th>处理记录</th>
            <th></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key => $vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label>
            </td>
            <td class="nowrap">
                <div class="headimg headimg-md" data-lazy-src="{$vo.user.headimg|default='__ROOT__/static/theme/img/headimg.png'}" data-tips-image></div>
                <div class="inline-block sub-span-blue">
                    <div>
                        <!--{notempty name='vo.user.username'}-->
                        用户姓名：<span class="color-text">{$vo.user.username|default='-'}</span>
                        <!--{else}-->
                        用户昵称：<span class="color-text">{$vo.user.nickname|default='-'}</span>
                        <!--{/notempty}-->
                        <span class="margin-left-5">[ <b class="color-red">VIP{$vo.user.vip_code}</b> ] <b class="color-red">{$vo.user.vip_name}</b></span>
                    </div>
                    <div>用户手机：<span class="color-text">{$vo.user.phone|default='-'}</span></div>
                    <div class="sub-strong-blue">剩余可提现 <b>{$vo.user.rebate_total-$vo.user.rebate_used}</b> 元 已提现 <b>{$vo.user.rebate_used+0}</b> 元 待到账 <b>{$vo.user.rebate_lock+0}</b> 元</div>
                </div>
            </td>
            <td class='text-left nowrap'>
                {eq name='vo.status' value='0'}<span class="layui-badge layui-badge-middle layui-bg-red">已失败</span>{/eq}
                {eq name='vo.status' value='1'}<span class="layui-badge layui-badge-middle layui-bg-cyan">待审核</span>{/eq}
                {eq name='vo.status' value='2'}<span class="layui-badge layui-badge-middle layui-bg-blue">已审核</span>{/eq}
                {eq name='vo.status' value='3'}<span class="layui-badge layui-badge-middle layui-bg-blue">待打款</span>{/eq}
                {eq name='vo.status' value='4'}<span class="layui-badge layui-badge-middle layui-bg-green">已打款</span>{/eq}
                {eq name='vo.status' value='5'}<span class="layui-badge layui-badge-middle layui-bg-green">已完成</span>{/eq}
                <div class="text-middle inline-block">
                    提现金额：<b class="color-blue">{$vo.amount+0}</b> 元
                    {if $vo.charge_amount>0}<span class="color-desc"> ( 含手续费 {$vo.charge_amount+0} 元 )</span>{/if}
                    <div>提现单号：<b class="color-blue">{$vo.code|default='--'}</b></div>
                    <div>提现方式：{$vo.type_name|default='-'}</div>
                    <div>提现描述：<span class="color-desc">{$vo.remark|default='-'}</span></div>
                </div>
            </td>
            <td class='text-left nowrap'>

                {in name='vo.type' value='wechat_banks,transfer_banks'}
                <div>开户银行：{$vo.bank_name|default='-'}</div>
                <div>开户分行：{$vo.bank_bran|default=''}</div>
                <div>账户姓名：{$vo.bank_user|default=''}</div>
                <div>银行卡号：{$vo.bank_code|default=''}</div>
                {/in}

                {in name='vo.type' value='wechat_qrcode,alipay_qrcode'}
                <div class="headimg headimg-md" data-lazy-src="{$vo.qrcode}" data-tips-image></div>
                {/in}

                {in name='vo.type' value='alipay_account'}
                <div>支付宝姓名：{$vo.alipay_user|default='-'}</div>
                <div>支付宝账号：{$vo.alipay_code|default=''}</div>
                {/in}

                {in name='vo.type' value='wechat_wallet'}
                <div class="color-desc">提现到微信钱包零钱</div>
                {/in}
            </td>
            <td class='text-left nowrap'>
                申请时间：{$vo.create_at|format_datetime}<br>
                最后处理：{$vo.change_time|format_datetime}<br>
                交易时间：{$vo.trade_time|format_datetime}<br>
                交易描述：<span class="color-desc">{$vo.change_desc|default='--'}</span><br>
            </td>
            <td class='text-left nowrap'>

                {if auth('auditStatus') and $vo.status eq 1}
                <a class="layui-btn layui-btn-sm layui-btn-normal" data-modal="{:url('auditStatus')}?code={$vo.code}">提现审核</a>
                {/if}

                {if auth('auditPayment') and in_array($vo.status, [2,3,4])}
                <a class="layui-btn layui-btn-sm" data-modal="{:url('auditPayment')}?code={$vo.code}">提现打款</a>
                {/if}

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>
{/block}
